import {
	ElMessage
} from 'element-plus'
import request from '../request/index.js'
import Router from "../router/index.js"
import configs from '../configs/index.js'
class api{
	static 获取处方=async (datas) => {
		let data ={}

		await request({
			url: '/hqcf',
			method: 'POST',
			data: datas
		}).then(res => {
			data=res.data
		}, err => {
			ElMessage.error("网络错误:"+err)
		})

		return data
	}

	static 组件修改=async (组件名,属性,样式,js,案例) => {
		let 提交 ={
			组件名:组件名,
			属性:属性,
			样式:样式,
			js:js,
			案例:案例
		}
		let data ={}

		await request({
			url: '/zjxg',
			method: 'POST',
			data: 提交
		}).then(res => {
			data=res.data
		}, err => {
			ElMessage.error("网络错误:"+err)
		})

		return data
	}

	static 获取组件=async (组件名) => {
		let 提交 ={
			组件名:组件名
		}
		let data ={}

		await request({
			url: '/getym',
			method: 'POST',
			data: 提交
		}).then(res => {
			data=res.data
		}, err => {
			ElMessage.error("网络错误:"+err)
		})

		return data
	}
	
	

}

export default api
